/*
 This file 'wxhggyApp' is part of Firebird Integrated Solution 1.0

 Copyright (c) 2020 Lincong

 Contact:  
        Email: lincong1987@gmail.com

        QQ: 159257119
 
 See Usage at http://www.jplatformx.com/firebird

 Create date: 2020-06-14 20:46
 */

define(function (require, exports, module) {
	require("Firebird.App");
	require("Firebird.Controller");
	// require("Format");


	require("../assets/header-datetime");
	require("../assets/flop");


	// var wxhggy_1_chart_1 = require("./wxhggy_1_chart_1");
	// var wxhggy_1_chart_2 = require("./wxhggy_1_chart_2");
	// var wxhggy_2 = require("./wxhggy_2");
	//
	// var wxhggy_4_chart_1 = require("./wxhggy_4_chart_1");

	// var chart_1 = require("./chart_1");

	var controller = Firebird.create("Firebird.Controller", {
		controller: "{contextPath}/publicMain"
	});

	Firebird.define("wxhggy.SearchApp", {
		extend: "Firebird.SearchApp",
		controller: controller,
		setContext: function () {
			var app = this, context = this.context;


			// context.wxhggy_1_chart_1 = wxhggy_1_chart_1;
			// context.wxhggy_1_chart_2 = wxhggy_1_chart_2;
			// context.wxhggy_2 = wxhggy_2;
			// context.wxhggy_4_chart_1 = wxhggy_4_chart_1;
			//
			//
			//
			// wxhggy_1_chart_1.setValue([]);
			// wxhggy_1_chart_2.setValue([]);
			// wxhggy_2.setValue([]);
			// chart_1.setValue([]);


			// $("#wxhggy_1_flop_1").flop({
			// 	value: 432
			// });


			// 标签 切换
			$(".tab").each(function () {
				var $this = $(this);
				$this.on("click", "a", function (e) {
					e.preventDefault();
					var $a = $(e.target).is("a") ? $(e.target) : $(e.target).closest("a");
					if (!$a.parent().hasClass("tab-header")) {
						return;
					}
					var index = $this.find("a").index($a);
					$a.addClass("active").siblings().removeClass("active")
					$this.find(".tab-content .content").eq(index).addClass("active").siblings().removeClass("active");
				});
			});
		},
		listener: {}
	});


});